Header compression for CCN messages using dictionary learning

ABSTRACT

One embodiment provides a system in a first node that facilitates efficient packet forwarding. During operation, the system identifies a type, length, and value (TLV) string in a packet and, in response, generates a compressed representation of the TLV string. The system stores the compressed representation for the TLV string in an entry of a learned dictionary in a storage device of the first node. The system then sends the entry to a second node and, in response, receives an acknowledgement from the second node. If the system identifies the TLV string in a subsequent second packet of the acknowledgement, the system compresses the TLV string in the second packet based on the compressed representation.

RELATED APPLICATION

The subject matter of this application is related to the subject matter in the following applications:

-   -   U.S. patent application Ser. No. 13/847,814, entitled         “ORDERED-ELEMENT NAMING FOR NAME-BASED PACKET FORWARDING,” by         inventor Ignacio Solis, filed 20 Mar. 2013 (hereinafter “U.S.         patent application Ser. No. 13/847,814”);     -   U.S. patent application Ser. No. 12/338,175, entitled         “CONTROLLING THE SPREAD OF INTERESTS AND CONTENT IN A CONTENT         CENTRIC NETWORK,” by inventors Van L. Jacobson and Diana K.         Smetters, filed 18 Dec. 2008 (hereinafter “U.S. patent         application Ser. No. 12/338,175”); and     -   U.S. patent application Ser. No. 14/065,691, entitled “SYSTEM         AND METHOD FOR HASH-BASED FORWARDING OF PACKETS WITH         HIERARCHICALLY STRUCTURED VARIABLE-LENGTH IDENTIFIERS,” by         inventors Marc E. Mosko and Michael F. Plass, filed 29 Oct. 2013         (hereinafter “U.S. patent application Ser. No. 14/065,691”); and         the disclosures of which are herein incorporated by reference in         their entirety.

BACKGROUND

Field

This disclosure is generally related to distribution of digital content. More specifically, this disclosure is related to header compression of a CCN message.

Related Art

The proliferation of the Internet and e-commerce continues to create a vast amount of digital content. Content-centric network (CCN) architectures have been designed to facilitate accessing and processing such digital content. A CCN includes entities, or nodes, such as network clients, forwarders (e.g., routers), and content producers, which communicate with each other by sending “interest” packets for various content items and receiving “content object” packets in return. CCN interests and content objects are identified by their unique names, which are typically hierarchically structured variable length identifiers (HSVLI). An HSVLI can include contiguous name components ordered from a most general level to a most specific level.

A CCN message (e.g., a message from a CCN node) may include a number of repeated fields in its header. In addition to actual values of different fields, the header may carry field information (e.g., type and length) associated with the fields. For example, different name components of an HSVLI can have different values as well their corresponding types and lengths. However, since each component of the HSVLI can be of type “name,” the same field information is repeated. As a result, the information in the header of a CCN message can become repetitious and lead to inefficient resource utilization while forwarding the packets.

SUMMARY

One embodiment provides a system in a first node that facilitates efficient packet forwarding. During operation, the system identifies a type, length, and value (TLV) string in a packet and, in response, generates a compressed representation of the TLV string. The system stores the compressed representation for the TLV string in an entry of a learned dictionary in a storage device of the first node. The system then sends the entry to a second node and, in response, receives an acknowledgement from the second node. If the system identifies the TLV string in a subsequent second packet of the acknowledgement, the system compresses the TLV string in the second packet based on the compressed representation.

In a variation on this embodiment, the compressed representation in the entry is a compressed replacement string. This compressed replacement string is mapped to the TLV string in the entry. The system then compresses the TLV string in the second packet by replacing the TLV string with the compressed replacement string.

In a further variation, a length of the compressed replacement string is proportional to a length of the TLV string in the entry.

In a variation on this embodiment, the compressed representation in the entry is a compressed counter comprising a compressor key. This compressor key is mapped to a type of the TLV string and a base value. The system then compresses the TLV string in the second packet by calculating an offset based on a value in the TLV string and the base value, and replacing the TLV string with the compressor key and the offset.

In a variation on this embodiment, the packet is a content-centric network (CCN) message. A name for the CCN message is a hierarchically structured variable length identifier (HSVLI), which comprises contiguous name components ordered from a most general level to a most specific level. The system then replaces a fixed header of the CCN message with a compressed fixed header.

In a further variation, the TLV string is one of: (i) a Key Identifier; (ii) a Public Key; (iii) a Certificate; and (iv) a Name Prefix.

In a variation on this embodiment, the first and second nodes store a static dictionary. The static dictionary maps a type and length (TL) string to a compressed replacement string. One or more TL strings of the acknowledgement from the second node is then compressed based on the static dictionary.

In a variation on this embodiment, the entry is timed out in response to inactivity over a period of time.

In a variation on this embodiment, the TLV string in the packet is a concatenation of a plurality of TLV strings.

BRIEF DESCRIPTION OF THE FIGURES

FIG. 1A illustrates an exemplary content-centric network (CCN) that facilitates header compression for messages, in accordance with an embodiment of the present invention.

FIG. 1B presents a flow chart illustrating a method for compressing headers of a CCN message, in accordance with an embodiment of the present invention.

FIG. 2A illustrates an exemplary compression-enabled fixed header of a CCN message, in accordance with an embodiment of the present invention.

FIG. 2B illustrates an exemplary compression header of a CCN message, in accordance with an embodiment of the present invention.

FIG. 2C illustrates exemplary compressed fixed header formats for a CCN message, in accordance with an embodiment of the present invention.

FIG. 2D presents a flow chart illustrating a method for compressing the fixed header of a CCN message, in accordance with an embodiment of the present invention.

FIG. 3A illustrates an exemplary compression of type and length (TL) pair(s) of the header of a CCN message based on a static dictionary lookup, in accordance with an embodiment of the present invention.

FIG. 3B illustrates exemplary compressed replacement string formats for compressing TL pair(s) of the header of a CCN message, in accordance with an embodiment of the present invention.

FIG. 3C presents a flow chart illustrating a method for compressing TL pair(s) of the header of a CCN message based on a static dictionary lookup, in accordance with an embodiment of the present invention.

FIG. 4A illustrates an exemplary compression of type, length, and value(s) (TLVs) of the header of a CCN message based on a learned dictionary lookup, in accordance with an embodiment of the present invention.

FIG. 4B presents a flow chart illustrating a method for learning TLV string(s) for creating a learned dictionary entry, in accordance with an embodiment of the present invention.

FIG. 4C presents a flow chart illustrating a method for compressing a TLV string of the header of a CCN message based on a learned dictionary lookup, in accordance with an embodiment of the present invention.

FIG. 5A illustrates exemplary formats for a bit-aligned encoded dictionary entry, in accordance with an embodiment of the present invention.

FIG. 5B presents a flow chart illustrating a method generating an encoded dictionary, in accordance with an embodiment of the present invention.

FIG. 6 illustrates an exemplary computer and communication system that facilitates header compression for CCN messages, in accordance with an embodiment of the present invention.

In the figures, like reference numerals refer to the same figure elements.

DETAILED DESCRIPTION

The following description is presented to enable any person skilled in the art to make and use the embodiments, and is provided in the context of a particular application and its requirements. Various modifications to the disclosed embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of the present disclosure. Thus, the present invention is not limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.

Overview

Embodiments of the present invention provide a system which facilitates header compression for a content-centric networking (CCN) message (also referred to as a CCN packet), such as an interest message, transmitted over a network. A CCN message includes a fixed header, zero or more optional header fields, and a plurality of message body fields. The fixed header includes a number of fields, which are typically over-provisioned in terms of bit length for most of the packets. Furthermore, the header and body fields are represented by a type, length, and value (TLV) format. Some of the of the TLV fields can include contiguous TL pairs without an intermediate value. This can lead to highly predictable information (e.g., a repeated type and length) in the header of the CCN message.

To solve this problem, embodiments of the presented invention compresses the fixed header using compressed fixed header formats and the TLV fields using static, learned, and/or encoded dictionaries. A CCN node maintains one or more compressed fixed header formats for compressing the fixed headers. The node also maintains a static dictionary, which can be predefined, for compressing TL pairs. The node can also learn TLV strings, generate a corresponding compressed replacement string, and maintain a mapping between them in an entry of a learned dictionary. The node shares this entry of the learned dictionary with a peer node, thereby allowing the node to compress the learned TLV string in the header of a subsequent message to the peer node. In some embodiments, the node can further encode the static dictionary by applying an encoding technique (e.g., Huffman encoding) to improve compression efficiency.

During operation, before transmitting a message to a peer, the node compresses the fixed header based on one of the compressed fixed header formats. The node then parses the header and message fields to obtain the TL pair strings, obtains respective compressed replacement strings (CRSs) matching the TL pair strings from the static dictionary, and replaces the TL pair strings with the corresponding replacement strings. In some embodiments, the node can look up the TL pair strings in the encoded dictionary instead of the static dictionary. In some further embodiments, the node can also parse the header and message fields to obtain the TLV strings, obtain respective compressed replacement strings matching the TLV strings from the learned dictionary, and replace the TLV strings with the corresponding compressed replacement strings. If a TL pair does not trigger a match in any of the dictionaries, the node can still reduce the length of the TL pair by using a compact representation of the TL pair in smaller bit fields. Using one or more of these techniques, the node compresses the header of a CCN message.

In this disclosure, the term “header compression” is used in the common usage of reducing the amount of framing and signaling overhead in a packet, excluding application payload. In a CCN message, header compression applies to the packet framing (fixed header), field framing (type-length-value), and signaling such as cryptographic keys or hash values that are part of the CCN protocol.

The following terms are used to describe the CCN architecture:

Content Object: A single piece of named data, which is bound to a unique name. Content Objects are “persistent,” which means that a Content Object can move around within a computing device, or across different computing devices, but does not change. If any component of the Content Object changes, the entity that made the change creates a new Content Object that includes the updated content, and binds the new Content Object to a new unique name.

Unique Names: A name in a CCN is typically location independent and uniquely identifies a Content Object. A data-forwarding device can use the name or name prefix to forward a packet toward a network node that generates or stores the Content Object, regardless of a network address or physical location for the Content Object. In some embodiments, the name may be a hierarchically structured variable-length identifier (HSVLI). The HSVLI can be divided into several hierarchical components, which can be structured in various ways. For example, the individual name components parc, home, ccn, and test.txt can be structured in a left-oriented prefix-major fashion to form the name “/parc/home/ccn/test.txt.” Thus, the name “/parc/home/ccn” can be a “parent” or “prefix” of “/parc/home/ccn/test.txt.” Additional components can be used to distinguish between different versions of the content item, such as a collaborative document.

In some embodiments, the name can include a non-hierarchical identifier, such as a hash value that is derived from the Content Object's data (e.g., a checksum value) and/or from elements of the Content Object's name. A description of a hash-based name is described in U.S. patent application Ser. No. 13/847,814.

A name can also be a flat label. Hereinafter, “name” is used to refer to any name for a piece of data in a name-data network, such as a hierarchical name or name prefix, a flat name, a fixed-length name, an arbitrary-length name, or a label (e.g., a Multiprotocol Label Switching (MPLS) label).

Interest: A packet that indicates a request for a piece of data, and includes a name (or a name prefix) for the piece of data. A data consumer can disseminate a request or Interest across an information-centric network, which CCN routers can propagate toward a storage device (e.g., a cache server) or a data producer that can provide the requested data to satisfy the request or Interest.

The methods disclosed herein are not limited to CCN networks and are applicable to other architectures as well. A description of a CCN architecture is described in U.S. patent application Ser. No. 12/338,175.

Exemplary Network and Communication

FIG. 1A illustrates an exemplary content-centric network (CCN) that facilitates header compression for messages, in accordance with an embodiment of the present invention. A network 100, which can be a CCN, can include a client device 116, a content producing device 118, and a router or other forwarding device at nodes 102, 104, 106, 108, 110, 112, and 114. A node can be a computer system, an end-point representing users, and/or a device that can generate interests or originate content. Suppose that peer CCN nodes 102 and 114 shares a static dictionary, a learned dictionary, and an encoded dictionary. Nodes 102 and 114 can also be aware of compressed fixed header formats supported by each other. In some embodiments, the static dictionary is pre-configured (e.g., by a network administrator) and propagated through network 100.

During operation, CCN node 102 can generate a message 120 (e.g., an interest for a piece of content). Message 120 includes a fixed header, an optional header, and a CCN message payload. Node 102 can compress the header and message fields of message 120 to generate a compressed header 121. Compressed header 121 can include one or more of: a compressed fixed header 122 generated based on the compressed fixed header formats, a compressed TL pair 124 based on the static (and/or encoded dictionary) and a corresponding value 125 of the TL pair, a compressed TLV 126 based on the learned dictionary, and a compacted TL pair 128, which has not matched an entry in a dictionary. In some embodiments, node 102 includes a context identifier in compressed header 121. The context identifier can indicate which dictionaries have been used to generate compressed header 121.

Node 102 transmits message 120 to peer CCN node 114. Node 114 receives message 120, obtains the context identifier from compressed header 121, and obtains dictionary information from the context identifier. Node 114 then obtains information from the header fields of compressed fixed header 122 based on its format. Node 114 then performs a reverse lookup (i.e., a reverse matching) in the static (and/or encoded) dictionary for the compressed TL pair 124 and obtains the original TL pair, and uses value 125 in the context of that TL pair. In the same way, node 114 obtains the original TLV from compressed TLV 126 based on the shared learned dictionary. Node 114 also obtains information from the fields of compacted TL pair 128 based on its format. Node 114, thus, generates an uncompressed header 130, which includes fixed header 132 and optional header 134, generated based on the reverse dictionary lookup. In this way, peer nodes 102 and 114 can exchange a CCN message with compressed header, thereby achieving efficiency in transmission and header processing.

Header Compression Overview

FIG. 1B presents a flow chart 150 illustrating a method for compressing headers of a CCN message, in accordance with an embodiment of the present invention. During operation, a header compression system of a CCN node identifies a candidate message for header compression (operation 152). Example of the candidate message include, but are not limited to, an uncompressed message received from another CCN node, a message whose header the CCN node has uncompressed, and a message generated by the CCN node. The system then compresses the fixed header of the message based on the compressed fixed header formats (operation 154). The formats represent the most common values for different fields of a fixed header in an efficient way.

The system looks up TL pair string(s) from the optional header and message body of the message in the static dictionary to identify the corresponding compressed replacement string(s). The system then replaces the TL pair string(s) with the identified compressed replacement string(s) (operation 156). In some embodiments, the system can perform the lookup in an encoded dictionary, which is generated by encoding the static dictionary (e.g., by applying Huffman encoding). If the encoded replacement strings are of variable length, encoded replacement strings is preceded by an encoded length of the TL pair string(s). The system then looks up TLV string(s) from the optional header and message body of the message in the learned dictionary to identify the corresponding compressed replacement string(s). The system then replaces the TLV string(s) with the identified compressed replacement string(s) (operation 158).

If any TL pair does not match a dictionary entry, the system may still reduce the size of the TL pair. The system then compacts the TL pair by using patterns for the TL pair(s) that do not match a dictionary entry (operation 160). In some embodiments, the system incorporates a context identifier in the compressed header (operation 162). This context identifier can precede the compressed fixed header and identify one or more dictionaries used to generate the compressed header. For example, if the peer nodes have a plurality of static dictionaries, the peer node receiving the message with the compressed header can determine which dictionary to use to decompress the compressed header from the context identifier.

Fixed Header Compression

FIG. 2A illustrates an exemplary compression-enabled fixed header of a CCN message, in accordance with an embodiment of the present invention. A regular fixed header 230 of the CCN message typically includes a plurality of fields. These fields include one or more of: version 202, packet type 204, packet length 206, hop limit 208, and header length 212. In addition, fixed header 230 can also include reserved field 210. However, when a node receives a packet with fixed header 230, the node may not recognize whether the header (i.e., the fixed and/or optional header) of packet is compressed.

To solve this problem, the format of fixed header 230 is changed to compression-enabled fixed header 232. The bits of version field 202 is redistributed to include a pattern field 200 (i.e., a bit pattern), a shorter version field 203, and a reserve bit 214. Pattern field 200 can indicate whether a packet is compressed. Pattern field 200 can also indicate which fixed header format is used to generate a compressed fixed header. For example, a pattern “000” can indicate that the packet is uncompressed, and a pattern “001” can indicate a specific compressed fixed header format.

FIG. 2B illustrates an exemplary compression header of a CCN message, in accordance with an embodiment of the present invention. A compression header 234 is prepended before a compressed fixed header 226. It should be noted that compressed fixed header 226 may have the same field lengths as fixed header 232. However, the pattern of compressed fixed header 226 still identifies it as a compressed header if the following optional header is compressed. In this way, a peer node is aware of a compressed optional header.

Compression header 234 includes a context pattern 220, a context identifier 222, and a cyclic redundancy check (CRC) field 224. In some embodiments, CRC field 224 is computed based on a RObust Header Compression (ROHC), as discussed in IETF Request for Comments (RFC) 4995, titled “The RObust Header Compression (ROHC) Framework,” available at http://tools.ietf.org/html/rfc4995, which is incorporated by reference herein. Context identifier 222 can have different lengths (e.g., 3 bits or 10 bits for byte alignment). Context pattern 220 indicates the length of the context identifier.

FIG. 2C illustrates exemplary compressed fixed header formats for a CCN message, in accordance with an embodiment of the present invention. In this example, compressed fixed header can be represented in format 241, 251, or 261. Each of these formats can be byte-aligned for efficient processing. Format 241 includes a pattern 242 (e.g., “010”) identifying format 241, a version field 243, a packet type field 244, a packet length field 245, and a hop limit field 246. Format 241 is suitable if the header has a fixed header length and does not need dedicated bits to represent it. Format 251 includes a pattern 252 (e.g., “011”) identifying format 251, a version field 253, a packet type field 254, a header length field 255, and a packet length field 256. Format 251 is suitable if a message does not have a hop limit.

Format 261 includes pattern 262 (e.g., “001” or “100”) identifying format 261, a version field 263, a packet type field 264, a header length field 265, a packet length field 266, and a hop limit field 267. Format 261 is suitable if a respective field of a fixed header is needed. However, the field lengths for format 261 can be different, and pattern 262 can indicate the difference in the field lengths. For example, if compressed fixed header 226 needs the same field lengths as fixed header 232, pattern 262 can assume one bit pattern (e.g., “001”). On the other hand, if the field lengths are shorter than fixed header 232, pattern 262 can assume another bit pattern (e.g., “100”). The fields in format 261 can remain the same, or the header length field can be further divided to represent a return code in addition to the header length.

FIG. 2D presents a flow chart 280 illustrating a method for compressing the fixed header of a CCN message, in accordance with an embodiment of the present invention. During operation, a header compression system of a CCN node identifies respective values of the fields of a fixed header of the message (operation 282) and determines a fixed header format based on the identified values (operation 284), as described in conjunction with FIG. 2C. The system then compresses the fixed header based on the determined fixed header format (operation 286).

TL Compression Using a Static Dictionary

FIG. 3A illustrates an exemplary compression of TL pair(s) of the header of a CCN message based on a static dictionary lookup, in accordance with an embodiment of the present invention. In this example, the optional header of the message includes a TLV 302, which includes a value V3, preceded by a set of contiguous TL pairs (T0, L0), (T1, L1), and (T2, L2) without any intermediate value. For example, the contiguous TL pairs can represent a validation type, a hash value (e.g., (Secure Hash Algorithm) SHA-256), and a key (e.g., a public key), and their respective lengths. Since each of these types and the corresponding lengths are fixed, contiguous TL pairs (T0, L0), (T1, L1), and (T2, L2) can be represented by a single compressed replacement string 306 in an entry in a static dictionary. The node can perform a lookup in the static dictionary, obtain string 306, and replace contiguous TL pairs (T0, L0), (T1, L1), and (T2, L2) as a compressed TL pair 304 in the header of the message. Here, the compression begins at a “type” (e.g., T0) and ends before a “value” (e.g., V3).

A static dictionary can be constructed using known TL pair strings based on an analysis of the domain knowledge (e.g., frequency analysis). A static dictionary can also be constructed for specific cases. For example, a static dictionary can exist for most commonly used TL pairs for a client. The node can include a plurality of static dictionaries and the context identifier can indicate which static dictionary has been used for compression. Before the node can start using a static dictionary, a respective other node in the network should also store a copy of the static dictionary. In some embodiments, a static dictionary is propagated to a respective node of the network.

FIG. 3B illustrates exemplary compressed replacement string formats for compressing TL pair(s) of the header of a CCN message, in accordance with an embodiment of the present invention. In this example, compressed replacement string 306 can be represented in format 311, 321, or 331. Each of these formats can be byte-aligned for efficient processing. Format 311 includes a pattern 312 (e.g., “10”) identifying format 311 and a compressor key 313. This compressor key 313 can represent the single or contiguous TL pair(s) in a compressed header. A compressor key is mapped to the corresponding TL pair(s) in the static dictionary. The number of bits to represent compressor key 313 can vary and pattern 312 indicates the number of bits allocated for compressor key 313. Format 311 is suitable if the TL pair(s) have a fixed length and does not need bits to represent it.

On the other hand, format 321 includes a pattern 322 (e.g., “0” or “110”) identifying format 321, a compressor key 323, and a length 324. The number of bits to represent compressor key 323 and/or length 324 can vary, and pattern 322 indicates the number of bits allocated for compressor key 323 and length 324. Compressor key 323 can represent the single or contiguous TL pair(s) and length 324 can represent a length of the TL pair(s). Format 321 is suitable if the TL pair(s) can be replaced with a compressed replacement string and whose length can be represented by the bits in length 324. Here, both formats 311 and 321 can encode a dictionary hit (i.e., a successful lookup in a static dictionary).

However, if a dictionary miss occurs, the node can still compact the TL pair(s) by using fewer bits to represent the type(s) and length(s). Format 331 represents the compacted TL pair(s). Format 331 includes a pattern 332 (e.g., “1110,” “111110,” or “1111111”) identifying format 331, a type 333, and a length 334. Number of bits to represent type 333 and/or length 334 can vary, and pattern 332 indicates the number of bits allocated for type 333 and length 334. For most of the TL pairs, the format 331 can be shorter than the length of a TL pair. In other words, format 331 can use fewer bytes to represent type 333 and/or length 334, thereby compacting the TL pair.

FIG. 3C presents a flow chart 350 illustrating a method for compressing TL pair(s) of the header of a CCN message based on a static dictionary lookup, in accordance with an embodiment of the present invention. During operation, a header compression system of a CCN node obtains a single or contiguous (i.e., without an intermediate value) TL pair string in the optional header of the message for a static dictionary lookup (operation 352). The system identifies an entry matching the token in the static dictionary (operation 354). The system then retrieves the compressed replacement string from the entry (operation 356) and replaces the TL pair string in the optional header and message body with the compressed replacement string (operation 358).

TLV Compression Using a Learned Dictionary

FIG. 4A illustrates an exemplary compression of TLVs of the header of a CCN message based on a learned dictionary lookup, in accordance with an embodiment of the present invention. In this example, the optional header of the message includes TLV 412, which includes a set of TLVs (T0, L0, V0), (T1, L1, V1), and (T2, L2, V2). If a TLV represents a token, the node learns the TLV string, creates a compressed replacement string 414, and creates an entry in a learned dictionary with compressed replacement string 414. On the other hand, if a TLV represents a counter, the node learns the TLV string, determines a replacement counter 416 comprising a compressor key 408, which encodes the type of the TLV and a base value 409 for an offset. The node creates an entry in the learned dictionary with replacement counter 416. Compressed replacement string 414 and replacement counter 416 can be byte-aligned for efficient processing. Here, the compression begins at a “type” (e.g., T0) and ends with a “value” (e.g., V2).

The node then shares the entries with a peer node. The node can send a separate exchange message (e.g., with the packet type of the fixed header indicating “Dictionary”). An exchange message can carry one or more dictionary entries (i.e., dictionary definitions) for both token and counter TLVs. The node can also send the dictionary entry using in-band exchange (e.g., piggyback in a data message). To facilitate streaming, the learned value is sent un-coded. The in-band exchange can have its own CRC, and use a reverse offset and length in the footer of the message to point to the dictionary information in the packet.

When the peer node receives the dictionary entries, the peer node sends an acknowledge back to the node. In some embodiments, the acknowledgement is based on the entries based on a static dictionary for efficient exchange of information. A respective node can maintain a timer for a respective entry in the learned (and static) dictionary. If an entry is not used for a period of time, the node times out the entry and removes it from the dictionary. Upon receiving the acknowledgement, the node replaces the token TLV string with compressed replacement string 414 in the header of any subsequent message. On the other hand, if the header of the message includes the counter TLV, the node obtains the current value from the counter TLV and computes an offset based on the current value and base value 409. The node then replaces the counter TLV string with replacement counter 416 followed by the offset.

For example, the TLVs can represent a name “/foo/bar/chunk=7.” Here, (T0, L0, V0) corresponds to a name type, the length of name component “foo,” and the string “foo,” respectively. Similarly, (T1, L1, V1) represents name component “bar” and (T2, L2, V2) represents name component “chunk=7.” A file can be subdivided into a plurality of chunks and “chunk=7” can represent the 8th chunk of the file. Since (T0, L0, V0) and (T1, L1, V1) is repeated for a respective chunk, the node can compress the TLV string representing (T0, L0, V0) and (T1, L1, V1) together with compressed replacement string 414. On the other hand, since (T2, L2, V2) represents a counter, the node can compress (T2, L2 V2) by replacing (T2, L2, V2) with replacement counter 416 followed by the offset (e.g., V2-base value 409).

When a peer node receives a message with a compressed optional header and message body, the peer node applies a reverse matching to the learned dictionary to obtain the token TLV string. In the same way, the peer node can obtain the base value for the counter TLV string. The peer node then uses the base value and the offset to calculate the value. It should be noted that the compression and decompression can be between two peer nodes, or the endpoints of a communication (e.g., generator and consumer of an interest).

If base value 409 needs to be changed (e.g., to accommodate a larger counter value), the node updates base value 409 in the entry with replacement counter 416 and sends the updated entry to the peer node. The node can use an exchange message or in-band exchange to send the updated entry. In some embodiments, the node can generate a plurality of replacement counters with different compressor keys for a counter TLV string in the learned dictionary. These replacement counters correspond to different base values, each representing a base for a range of counter values. The node shares these replacement counters with the peer node. When a larger counter value is needed, the node simply uses the base value for the next range of counter value. In this way, the node can avoid waiting for an exchange acknowledgement from a peer node.

In this example, compressed replacement string 414 includes a pattern 402 (e.g., “11110,” “1111110,” or “11111110”) and a compressor key 404. Number of bits to represent (i.e., the length of) compressor key 404 can vary and pattern 402 indicates the number of bits allocated for compressor key 404. The length of compressor key 404 (and hence, compressed replacement string 414) can be proportional to the length of the TLV string in the entry of the learned dictionary. For example, if the TLV string is a name segment, a key identifier, or a public key, the length of compressed replacement string 414 can be 2, 3, or 4 bytes, respectively. Similarly, replacement counter 416 includes a pattern 406, which indicates the number of bits allocated for compressor key 408. To calculate an offset efficiently, a calculated offset can have a prefix (e.g., “0,” “10,” “110,” “1110,” and “11110”) representing a range of offset. The offset then only uses the bits needed to indicate a value within that range, thereby achieving further compression.

FIG. 4B presents a flow chart 450 illustrating a method for learning TLV string(s) for creating a learned dictionary entry, in accordance with an embodiment of the present invention. During operation, a header compression system of a CCN node learns a specific TLV string from the header of a message (operation 452). The system then checks whether the learned TLV string is a counter TLV string (operation 454), as described in conjunction with FIG. 4A. If not, the system creates an entry comprising a compressed replacement string mapped to the learned TLV string in the learned dictionary (operation 456). Otherwise, the system creates an entry comprising a replacement counter mapped to a base value for the counter and the type of the learned TLV string in the learned dictionary (operation 458). The system then exchanges the entries with a peer node using an exchange message and/or an in-band exchange (operation 460).

FIG. 4C presents a flow chart 470 illustrating a method for compressing a TLV string of the header of a CCN message based on a learned dictionary lookup, in accordance with an embodiment of the present invention. During operation, a header compression system of a CCN node obtains a TLV string for a learned dictionary lookup (operation 472) and identifies an entry matching the TLV string (or the type of the TLV string) in the learned dictionary (operation 474). The system then checks whether the entry is a counter entry (operation 476).

If not, the system retrieves the compressed replacement string from the entry (operation 478) and replaces the TLV string with the compressed replacement string (operation 480). Otherwise, the system retrieves a replacement counter and the base value for the counter from the entry (operation 482). The system then obtains a current value from the TLV string and calculates an offset based on the base value and the current value (operation 484). The system replaces the TLV string with the replacement counter followed by the offset (operation 486).

TL Compression Using an Encoded Dictionary

FIG. 5A illustrates exemplary formats for a bit-aligned encoded dictionary entry, in accordance with an embodiment of the present invention. In this example, a CCN node can apply an encoding to a static dictionary 502 to generate an encoded dictionary 504. In some embodiments, the encoding is Huffman encoding. As a result, an entry in encoded dictionary 504 can correspond to a leaf node of a Huffman tree representing the compressed replacement strings in static dictionary 502. By encoding a compressed replacement string, the node generates a corresponding encoded replacement string 506. Encoded replacement string 506 can represent a fixed TL pair, contiguous TL pairs, a fixed type and a bit length, and a fixed type and an encoded length.

In this example, encoded replacement string 506 can be represented in format 522 or 524. Since encoded replacement string 506 can be generated based on Huffman encoding, these formats can be bit-aligned. Format 522 includes a pattern 512 (e.g., “0”) indicating that an encoded dictionary should be used for decompressing. Format 522 also includes an encoded compressor key 514, which is a string from a Huffman tree. In format 524, encoded compressor key 514 precedes an encoded length field 516. Encoded length field 516 includes a prefix corresponding to a range of values. The rest of the bits are used to represent a value in that range. Compressing TL pair(s) using an encoded dictionary has been described in conjunction with FIG. 3C.

FIG. 5B presents a flow chart 550 illustrating a method generating an encoded dictionary, in accordance with an embodiment of the present invention. During operation, a header compression system of a CCN node identifies compressed replacement strings from a static dictionary (operation 552). The system encodes the identified strings based on the weights (e.g., the respective frequencies) of the corresponding TL pair(s) (operation 554). In some embodiments, this encoding is done based on Huffman encoding and the weight represents the frequency of appearance of the corresponding TL pair(s). The system generates encoded replacement strings based on the encoding (operation 556) and encoded lengths for encoded replacement strings with variable lengths (operation 558). The system then includes the encoded replacement strings (and their encoded lengths, if applicable) in the encoded dictionary (operation 560).

Exemplary Computer and Communication System

FIG. 6 illustrates an exemplary computer and communication system that facilitates header compression for CCN messages, in accordance with an embodiment of the present invention. A computer and communication system 602 includes a processor 604, a memory 606, and a storage device 608. Memory 606 can include a volatile memory (e.g., RAM) that serves as a managed memory, and can be used to store one or more memory pools. Furthermore, computer and communication system 602 can be coupled to a display device 610, a keyboard 612, and a pointing device 614. Storage device 608 can store an operating system 616, a header compression system 618, and data 632.

Header compression system 618 can include instructions, which when executed by computer and communication system 602, can cause computer and communication system 802 to perform methods and/or processes described in this disclosure. Specifically, header compression system 618 may include instructions for receiving a packet that corresponds to a content-centric network (CCN) message, where a name for the CCN message is a hierarchically structured variable-length identifier (HSVLI) which comprises contiguous name components ordered from a most general level to a most specific level (communication mechanism 628).

Header compression system 618 can further include instructions for compressing fixed headers of a CCN message (fixed header compression mechanism 620). Header compression system 618 can also include instructions for compressing (and decompressing) single or contiguous TL pair(s) based on a static dictionary (static compression mechanism 622). Header compression system 618 can include instructions for learning TLV strings in a learned dictionary and compressing (and decompressing) the TLV strings based on the learned dictionary (learned compression mechanism 624). Header compression system 618 can also include instructions for exchanging the learned dictionary with peer nodes (communication mechanism 628). Furthermore, header compression system 618 can include instructions learning for encoding the static dictionary to create an encoded dictionary and compressing (and decompressing) single or contiguous TL pair(s) using the encoded dictionary (encoded compression mechanism 626). The dictionaries can be stored in memory 606 and/or storage device 608.

Data 632 can include any data that is required as input or that is generated as output by the methods and/or processes described in this disclosure. Specifically, data 632 can store at least: a packet that corresponds to a content-centric network (CCN) message; a name for the CCN message that is a hierarchically structured variable length identifier (HSVLI) which comprises contiguous name components ordered from a most general level to a most specific level; a CCN message that is an interest message; a packet that corresponds to an interest return message; an indication of an error condition corresponding to no available forwarding route corresponding to the name of the CCN message or interest message.

The data structures and code described in this detailed description are typically stored on a computer-readable storage medium, which may be any device or medium that can store code and/or data for use by a computer system. The computer-readable storage medium includes, but is not limited to, volatile memory, non-volatile memory, magnetic and optical storage devices such as disk drives, magnetic tape, CDs (compact discs), DVDs (digital versatile discs or digital video discs), or other media capable of storing computer-readable media now known or later developed.

The methods and processes described in the detailed description section can be embodied as code and/or data, which can be stored in a computer-readable storage medium as described above. When a computer system reads and executes the code and/or data stored on the computer-readable storage medium, the computer system performs the methods and processes embodied as data structures and code and stored within the computer-readable storage medium.

Furthermore, the methods and processes described above can be included in hardware modules or apparatus. The hardware modules or apparatus can include, but are not limited to, application-specific integrated circuit (ASIC) chips, field-programmable gate arrays (FPGAs), dedicated or shared processors that execute a particular software module or a piece of code at a particular time, and other programmable-logic devices now known or later developed. When the hardware modules or apparatus are activated, they perform the methods and processes included within them.

The foregoing descriptions of embodiments of the present invention have been presented for purposes of illustration and description only. They are not intended to be exhaustive or to limit the present invention to the forms disclosed. Accordingly, many modifications and variations will be apparent to practitioners skilled in the art. Additionally, the above disclosure is not intended to limit the present invention. The scope of the present invention is defined by the appended claims. 

What is claimed is:
 1. A computer-implemented method for efficient packet forwarding, the method comprising: generating a compressed representation of a type, length, and value (TLV) string in response to identifying the TLV string in a packet; storing the compressed representation for the TLV string in an entry of a learned dictionary in a storage device of a first node, wherein the compressed representation in the entry is a compressed counter comprising a compressor key, and wherein the compressor key is mapped to a type of the TLV string and a base value in the entry; sending from the first node the entry to a second node; receiving, by the first node, an acknowledgement from the second node; and in response to identifying the TLV string in a subsequent second packet of the acknowledgement, compressing the TLV string in the second packet based on the compressed representation, wherein compressing the TLV string in the second packet further comprises: calculating an offset based on a value in the TLV string and the base value; and replacing the TLV string with the compressor key and the offset.
 2. The method of claim 1, wherein the compressed representation in the entry is a compressed replacement string, wherein the compressed replacement string is mapped to the TLV string in the entry; and wherein compressing the TLV string in the second packet further comprises replacing the TLV string with the compressed replacement string.
 3. The method of claim 2, wherein a length of the compressed replacement string is proportional to a length of the TLV string in the entry.
 4. The method of claim 1, wherein the packet is a content-centric network (CCN) message, and wherein a name for the CCN message is a hierarchically structured variable length identifier (HSVLI), which comprises contiguous name components ordered from a most general level to a most specific level; wherein the method further comprises replacing a fixed header of the CCN message with a compressed fixed header.
 5. The method of claim 4, wherein the TLV string is one of: a Key Identifier; a Public Key; a Certificate; and a Name Prefix.
 6. The method of claim 1, wherein the first and second nodes store a static dictionary, wherein the static dictionary maps a type and length (TL) string to a compressed replacement TL string, and wherein the acknowledgement from the second node includes one or more compressed replacement TL strings compressed based on the static dictionary.
 7. The method of claim 1, wherein the entry is timed out in response to inactivity over a period of time.
 8. The method of claim 1, wherein the TLV string in the packet is a concatenation of a plurality of TLV strings.
 9. A computer system for facilitating forwarding of packets, the system comprising: a processor; and a storage device storing instructions that when executed by the processor cause the processor to perform a method, the method comprising: generating a compressed representation of a type, length, and value (TLV) string in response to identifying the TLV string in a packet; storing the compressed representation for the TLV string in an entry of a learned dictionary in a storage device of a first node, wherein the compressed representation in the entry is a compressed counter comprising a compressor key, and wherein the compressor key is mapped to a type of the TLV string and a base value in the entry; sending from the first node the entry to a second node; receiving, by the first node, an acknowledgement from the second node; and in response to identifying the TLV string in a subsequent second packet of the acknowledgement, compressing the TLV string in the second packet based on the compressed representation, wherein compressing the TLV string in the second packet further comprises: calculating an offset based on a value in the TLV string and the base value; and replacing the TLV string with the compressor key and the offset.
 10. The computer system of claim 9, wherein the compressed representation in the entry is a compressed replacement string, wherein the compressed replacement string is mapped to the TLV string in the entry; and wherein compressing the TLV string in the second packet further comprises replacing the TLV string with the compressed replacement string.
 11. The computer system of claim 10, wherein a length of the compressed replacement string is proportional to a length of the TLV string in the entry.
 12. The computer system of claim 9, wherein the packet is a content centric network (CCN) message, and wherein a name for the CCN message is a hierarchically structured variable length identifier (HSVLI) which comprises contiguous name components ordered from a most general level to a most specific level; wherein the method further comprises replacing a fixed header of the CCN message with a compressed fixed header.
 13. The computer system of claim 12, wherein the TLV string is one of: a Key Identifier; a Public Key; a Certificate; and a Name Prefix.
 14. The computer system of claim 9, wherein the first and second nodes store a static dictionary, wherein the static dictionary maps a type and length (TL) string to a compressed replacement TL string, and wherein the acknowledgement from the second node includes one or more compressed replacement TL strings compressed based on the static dictionary.
 15. The computer system of claim 9, wherein the entry is timed out in response to inactivity over a period of time.
 16. The computer system of claim 9, wherein the TLV string in the packet is a concatenation of a plurality of TLV strings.
 17. A non-transitory computer-readable storage medium storing instructions that when executed by a computer cause the computer to perform a method, the method comprising: generating a compressed representation of a type, length, and value (TLV) string in response to identifying the TLV string in a packet; storing the compressed representation for the TLV string in an entry of a learned dictionary in a storage device of a first node, wherein the compressed representation in the entry is a compressed counter comprising a compressor key, and wherein the compressor key is mapped to a type of the TLV string and a base value in the entry; sending from the first node the entry to a second node; receiving, by the first node, an acknowledgement from the second node; and in response to identifying the TLV string in a subsequent second packet of the acknowledgement, compressing the TLV string in the second packet based on the compressed representation, wherein compressing the TLV string in the second packet further comprises: calculating an offset based on a value in the TLV string and the base value; and replacing the TLV string with the compressor key and the offset.
 18. The non-transitory computer-readable storage medium of claim 17, wherein the packet is a content-centric network (CCN) message, and wherein a name for the CCN message is a hierarchically structured variable length identifier (HSVLI) which comprises contiguous name components ordered from a most general level to a most specific level; wherein the method further comprises replacing a fixed header of the CCN message with a compressed fixed header.
 19. The non-transitory computer-readable storage medium of claim 17, wherein the compressed representation in the entry is a compressed replacement string, wherein the compressed replacement string is mapped to the TLV string in the entry; and wherein compressing the TLV string in the second packet further comprises replacing the TLV string with the compressed replacement string.
 20. The non-transitory computer-readable storage medium of claim 19, wherein a length of the compressed replacement string is proportional to a length of the TLV string in the entry. 